﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QingZhouLinYe_Web
{
    public class Polygon
    {
        public Location[] polygon { get; set; }


        public Polygon(Location[] locations)
        {
            polygon = locations;
        }

        public override string ToString()
        {
            string linestr = "";
            for (int i = 0; i < polygon.Count(); i++)
            {
                linestr += polygon[i].X + " " + polygon[i].Y + " " + polygon[i].Z + ",";
            }
            linestr = linestr.Substring(0, linestr.Length - 1);
            return $"POLYGON ((" + linestr + "))";
        }
    }
}